from LeetCoder import *


class Solution:

    def maxStrength(self, nums: List[int]) -> int:
        n = len(nums)
        limit = (1 << n)
        ans = -inf
        for i in range(limit):
            cur = None
            for j in range(n):
                if (1 << j) & i != 0:
                    if cur is None:
                        cur = nums[j]
                    else:
                        cur *= nums[j]
            if cur is not None:
                ans = max(ans, cur)
        return ans



s = Solution()
print(s)
